<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.3.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"movie0125.gitee.io","root":"/","scheme":"Mist","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"};
  </script>

  <meta name="description" content="LFS学习笔记（八）本章进行系统初始化设置，包括网络，系统时间，键盘，配置文件和 systemd 服务等。">
<meta property="og:type" content="article">
<meta property="og:title" content="lfs-notebook-08">
<meta property="og:url" content="https://movie0125.gitee.io/2021/06/09/lfs-notebook-08/index.html">
<meta property="og:site_name" content="Movie Blog">
<meta property="og:description" content="LFS学习笔记（八）本章进行系统初始化设置，包括网络，系统时间，键盘，配置文件和 systemd 服务等。">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2021-06-09T07:51:44.000Z">
<meta property="article:modified_time" content="2021-07-08T03:06:49.955Z">
<meta property="article:author" content="Movie">
<meta property="article:tag" content="LFS">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="https://movie0125.gitee.io/2021/06/09/lfs-notebook-08/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>lfs-notebook-08 | Movie Blog</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">Movie Blog</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">拥抱开源，快乐分享</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-fw fa-home"></i>首页</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/about/" rel="section"><i class="fa fa-fw fa-user"></i>关于</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-fw fa-tags"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-fw fa-th"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-fw fa-archive"></i>归档</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
  </div>
</div>

    </div>
  </div>

</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>
  <div class="reading-progress-bar"></div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://movie0125.gitee.io/2021/06/09/lfs-notebook-08/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="Movie">
      <meta itemprop="description" content="学习，记录，分享，收获">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Movie Blog">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          lfs-notebook-08
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2021-06-09 15:51:44" itemprop="dateCreated datePublished" datetime="2021-06-09T15:51:44+08:00">2021-06-09</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2021-07-08 11:06:49" itemprop="dateModified" datetime="2021-07-08T11:06:49+08:00">2021-07-08</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/" itemprop="url" rel="index"><span itemprop="name">学习笔记</span></a>
                </span>
            </span>

          
            <span class="post-meta-item" title="阅读次数" id="busuanzi_container_page_pv" style="display: none;">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span id="busuanzi_value_page_pv"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2021/06/09/lfs-notebook-08/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2021/06/09/lfs-notebook-08/" itemprop="commentCount"></span>
    </a>
  </span>
  
  

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h1 id="LFS学习笔记（八）"><a href="#LFS学习笔记（八）" class="headerlink" title="LFS学习笔记（八）"></a>LFS学习笔记（八）</h1><pre><code>本章进行系统初始化设置，包括网络，系统时间，键盘，配置文件和 systemd 服务等。</code></pre>
<a id="more"></a>

<h2 id="准备进入环境"><a href="#准备进入环境" class="headerlink" title="准备进入环境"></a>准备进入环境</h2><pre><code>之前的虚拟机被关闭了，重新挂载目录并进入 `chroot` 环境</code></pre>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">mount /dev/vdb  /mnt/lfs</span><br><span class="line">sudo su - root</span><br><span class="line"></span><br><span class="line">chroot <span class="string">&quot;<span class="variable">$LFS</span>&quot;</span> /usr/bin/env -i          \</span><br><span class="line">    HOME=/root TERM=<span class="string">&quot;<span class="variable">$TERM</span>&quot;</span>            \</span><br><span class="line">    PS1=<span class="string">&#x27;(lfs chroot) \u:\w\$ &#x27;</span>        \</span><br><span class="line">    PATH=/bin:/usr/bin:/sbin:/usr/sbin \</span><br><span class="line">    /bin/bash --login</span><br></pre></td></tr></table></figure>

<h2 id="系统配置"><a href="#系统配置" class="headerlink" title="系统配置"></a>系统配置</h2><ul>
<li>/etc/systemd/network/10-ether0.link 配置网卡MAC地址与网卡名称对应关系</li>
<li>/etc/systemd/network/10-eth-static.network 配置网卡IP地址</li>
<li>/etc/resolv.conf   配置DNS服务器地址</li>
<li>/etc/hostname 配置主机名</li>
<li>/etc/hosts    配置本地域名解析</li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 写入规则建立符号链接</span></span><br><span class="line">cat &gt; /etc/udev/rules.d/83-duplicate_devs.rules &lt;&lt; <span class="string">&quot;EOF&quot;</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># Persistent symlinks for webcam and tuner</span></span><br><span class="line">KERNEL==<span class="string">&quot;video*&quot;</span>, ATTRS&#123;idProduct&#125;==<span class="string">&quot;1910&quot;</span>, ATTRS&#123;idVendor&#125;==<span class="string">&quot;0d81&quot;</span>, \</span><br><span class="line">    SYMLINK+=<span class="string">&quot;webcam&quot;</span></span><br><span class="line">KERNEL==<span class="string">&quot;video*&quot;</span>, ATTRS&#123;device&#125;==<span class="string">&quot;0x036f&quot;</span>, ATTRS&#123;vendor&#125;==<span class="string">&quot;0x109e&quot;</span>, \</span><br><span class="line">    SYMLINK+=<span class="string">&quot;tvtuner&quot;</span></span><br><span class="line"></span><br><span class="line">EOF</span><br><span class="line"></span><br><span class="line"><span class="comment"># 将硬件时钟设置为本地时间，使用以下命令建立 /etc/adjtime ：</span></span><br><span class="line"></span><br><span class="line">cat &gt; /etc/adjtime &lt;&lt; <span class="string">&quot;EOF&quot;</span></span><br><span class="line">0.0 0 0.0</span><br><span class="line">0</span><br><span class="line">LOCAL</span><br><span class="line">EOF</span><br><span class="line"></span><br><span class="line"><span class="comment"># inputrc 文件的作用是告知系统应该以怎样的键盘布局处理键盘。此文件对于 readline —— 输入相关库，或者是一些 shell （例如 bash 等）来说十分重要。</span></span><br><span class="line">cat &gt; /etc/inputrc &lt;&lt; <span class="string">&quot;EOF&quot;</span></span><br><span class="line"><span class="comment"># Begin /etc/inputrc</span></span><br><span class="line"><span class="comment"># Modified by Chris Lynn &lt;roryo@roryo.dynup.net&gt;</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># Allow the command prompt to wrap to the next line</span></span><br><span class="line"><span class="built_in">set</span> horizontal-scroll-mode Off</span><br><span class="line"></span><br><span class="line"><span class="comment"># Enable 8bit input</span></span><br><span class="line"><span class="built_in">set</span> meta-flag On</span><br><span class="line"><span class="built_in">set</span> input-meta On</span><br><span class="line"></span><br><span class="line"><span class="comment"># Turns off 8th bit stripping</span></span><br><span class="line"><span class="built_in">set</span> convert-meta Off</span><br><span class="line"></span><br><span class="line"><span class="comment"># Keep the 8th bit for display</span></span><br><span class="line"><span class="built_in">set</span> output-meta On</span><br><span class="line"></span><br><span class="line"><span class="comment"># none, visible or audible</span></span><br><span class="line"><span class="built_in">set</span> bell-style none</span><br><span class="line"></span><br><span class="line"><span class="comment"># All of the following map the escape sequence of the value</span></span><br><span class="line"><span class="comment"># contained in the 1st argument to the readline specific functions</span></span><br><span class="line"><span class="string">&quot;\eOd&quot;</span>: backward-word</span><br><span class="line"><span class="string">&quot;\eOc&quot;</span>: forward-word</span><br><span class="line"></span><br><span class="line"><span class="comment"># for linux console</span></span><br><span class="line"><span class="string">&quot;\e[1~&quot;</span>: beginning-of-line</span><br><span class="line"><span class="string">&quot;\e[4~&quot;</span>: end-of-line</span><br><span class="line"><span class="string">&quot;\e[5~&quot;</span>: beginning-of-history</span><br><span class="line"><span class="string">&quot;\e[6~&quot;</span>: end-of-history</span><br><span class="line"><span class="string">&quot;\e[3~&quot;</span>: delete-char</span><br><span class="line"><span class="string">&quot;\e[2~&quot;</span>: quoted-insert</span><br><span class="line"></span><br><span class="line"><span class="comment"># for xterm</span></span><br><span class="line"><span class="string">&quot;\eOH&quot;</span>: beginning-of-line</span><br><span class="line"><span class="string">&quot;\eOF&quot;</span>: end-of-line</span><br><span class="line"></span><br><span class="line"><span class="comment"># for Konsole</span></span><br><span class="line"><span class="string">&quot;\e[H&quot;</span>: beginning-of-line</span><br><span class="line"><span class="string">&quot;\e[F&quot;</span>: end-of-line</span><br><span class="line"></span><br><span class="line"><span class="comment"># End /etc/inputrc</span></span><br><span class="line">EOF</span><br><span class="line"></span><br><span class="line"><span class="comment"># shells 文件是当前系统所有可用 shell 的列表文件</span></span><br><span class="line">cat &gt; /etc/shells &lt;&lt; <span class="string">&quot;EOF&quot;</span></span><br><span class="line"><span class="comment"># Begin /etc/shells</span></span><br><span class="line"></span><br><span class="line">/bin/sh</span><br><span class="line">/bin/bash</span><br><span class="line"></span><br><span class="line"><span class="comment"># End /etc/shells</span></span><br><span class="line">EOF</span><br><span class="line"></span><br></pre></td></tr></table></figure>
<ul>
<li>配置Linux控制台 略过</li>
<li>配置系统语言环境 略过</li>
</ul>
<h2 id="让-LFS-系统可引导"><a href="#让-LFS-系统可引导" class="headerlink" title="让 LFS 系统可引导"></a>让 LFS 系统可引导</h2><h3 id="磁盘格式"><a href="#磁盘格式" class="headerlink" title="磁盘格式"></a>磁盘格式</h3><p>由于 LFS 的内核（5.2.8）默认编译参数不支持qemu虚拟机的 <code>VirtIO</code> 格式的硬盘，所以需要把虚拟机硬盘的格式改为 <code>SATA</code> 盘。</p>
<h3 id="编译安装内核"><a href="#编译安装内核" class="headerlink" title="编译安装内核"></a>编译安装内核</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">cd</span> /sources/build/</span><br><span class="line">tar xf ../linux-5.2.8.tar.xz</span><br><span class="line"><span class="built_in">cd</span> linux-5.2.8/</span><br><span class="line"></span><br><span class="line">make mrproper</span><br><span class="line">make defconfig</span><br><span class="line">make menuconfig <span class="comment">#打开需要的内核配置项</span></span><br><span class="line"></span><br><span class="line">make</span><br><span class="line">make modules_install</span><br><span class="line"></span><br><span class="line"><span class="comment">#宿主系统拥有单独的 /boot 分区，那么文件就应该复制到那里。简单的解决方法就是在执行前将 /boot 绑定到宿主的 /mnt/lfs/boot。以宿主系统中的 root 用户运行：</span></span><br><span class="line">mount --<span class="built_in">bind</span> /boot /mnt/lfs/boot</span><br><span class="line"></span><br><span class="line">cp -iv arch/x86/boot/bzImage /boot/vmlinuz-5.2.8-lfs-9.0-systemd</span><br><span class="line">cp -iv System.map /boot/System.map-5.2.8</span><br><span class="line">cp -iv .config /boot/config-5.2.8</span><br><span class="line">install -d /usr/share/doc/linux-5.2.8</span><br><span class="line">cp -r Documentation/* /usr/share/doc/linux-5.2.8</span><br><span class="line"></span><br><span class="line"><span class="comment"># 配置 Linux 模块加载顺序</span></span><br><span class="line">install -v -m755 -d /etc/modprobe.d</span><br><span class="line">cat &gt; /etc/modprobe.d/usb.conf &lt;&lt; <span class="string">&quot;EOF&quot;</span></span><br><span class="line"><span class="comment"># Begin /etc/modprobe.d/usb.conf</span></span><br><span class="line"></span><br><span class="line">install ohci_hcd /sbin/modprobe ehci_hcd ; /sbin/modprobe -i ohci_hcd ; <span class="literal">true</span></span><br><span class="line">install uhci_hcd /sbin/modprobe ehci_hcd ; /sbin/modprobe -i uhci_hcd ; <span class="literal">true</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># End /etc/modprobe.d/usb.conf</span></span><br><span class="line">EOF</span><br></pre></td></tr></table></figure>
<h3 id="配置-grub"><a href="#配置-grub" class="headerlink" title="配置 grub"></a>配置 grub</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">## BEGIN LFS</span></span><br><span class="line"></span><br><span class="line">insmod ext2</span><br><span class="line"><span class="built_in">set</span> root=(hd0,msdos1)  <span class="comment">#boot分区</span></span><br><span class="line"></span><br><span class="line">menuentry <span class="string">&quot;GNU/Linux, Linux 5.2.8-lfs-9.0-systemd&quot;</span> &#123;</span><br><span class="line">        linux   /vmlinuz-5.2.8-lfs-9.0-systemd root=/dev/sda1 ro</span><br><span class="line">&#125;   </span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment">## END LFS</span></span><br></pre></td></tr></table></figure>

<h3 id="创建-etc-fstab-文件"><a href="#创建-etc-fstab-文件" class="headerlink" title="创建 /etc/fstab 文件"></a>创建 /etc/fstab 文件</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">cat &gt; &#x2F;etc&#x2F;fstab &lt;&lt; &quot;EOF&quot;</span><br><span class="line"></span><br><span class="line"># file system  mount-point  type     options             dump  fsck</span><br><span class="line">#                                                              order</span><br><span class="line"></span><br><span class="line">&#x2F;dev&#x2F;sda1       &#x2F;               ext4            rw,relatime     0 1</span><br><span class="line">&#x2F;dev&#x2F;sdb1       &#x2F;boot           ext4            rw,relatime     0 2</span><br><span class="line">EOF</span><br><span class="line"></span><br></pre></td></tr></table></figure>
<h3 id="重启引导系统"><a href="#重启引导系统" class="headerlink" title="重启引导系统"></a>重启引导系统</h3><p>选择LFS启动项 <code>GNU/Linux, Linux 5.2.8-lfs-9.0-systemd</code></p>

    </div>

    
    
    

      <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/LFS/" rel="tag"># LFS</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2021/06/09/lfs-notebook-07/" rel="prev" title="lfs-notebook-07">
      <i class="fa fa-chevron-left"></i> lfs-notebook-07
    </a></div>
      <div class="post-nav-item">
    <a href="/2022/03/16/coreos-pxe-libvirt-http/" rel="next" title="coreos-ipxe-http">
      coreos-ipxe-http <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          
    <div class="comments" id="valine-comments"></div>

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#LFS%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0%EF%BC%88%E5%85%AB%EF%BC%89"><span class="nav-number">1.</span> <span class="nav-text">LFS学习笔记（八）</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%87%86%E5%A4%87%E8%BF%9B%E5%85%A5%E7%8E%AF%E5%A2%83"><span class="nav-number">1.1.</span> <span class="nav-text">准备进入环境</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E7%B3%BB%E7%BB%9F%E9%85%8D%E7%BD%AE"><span class="nav-number">1.2.</span> <span class="nav-text">系统配置</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E8%AE%A9-LFS-%E7%B3%BB%E7%BB%9F%E5%8F%AF%E5%BC%95%E5%AF%BC"><span class="nav-number">1.3.</span> <span class="nav-text">让 LFS 系统可引导</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E7%A3%81%E7%9B%98%E6%A0%BC%E5%BC%8F"><span class="nav-number">1.3.1.</span> <span class="nav-text">磁盘格式</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E7%BC%96%E8%AF%91%E5%AE%89%E8%A3%85%E5%86%85%E6%A0%B8"><span class="nav-number">1.3.2.</span> <span class="nav-text">编译安装内核</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E9%85%8D%E7%BD%AE-grub"><span class="nav-number">1.3.3.</span> <span class="nav-text">配置 grub</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%88%9B%E5%BB%BA-etc-fstab-%E6%96%87%E4%BB%B6"><span class="nav-number">1.3.4.</span> <span class="nav-text">创建 &#x2F;etc&#x2F;fstab 文件</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E9%87%8D%E5%90%AF%E5%BC%95%E5%AF%BC%E7%B3%BB%E7%BB%9F"><span class="nav-number">1.3.5.</span> <span class="nav-text">重启引导系统</span></a></li></ol></li></ol></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">Movie</p>
  <div class="site-description" itemprop="description">学习，记录，分享，收获</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">14</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">3</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">7</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2022</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Movie</span>
</div>

        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="总访客量">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="总访问量">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/muse.js"></script>


<script src="/js/next-boot.js"></script>




  




  
<script src="/js/local-search.js"></script>











<script>
if (document.querySelectorAll('pre.mermaid').length) {
  NexT.utils.getScript('//cdn.jsdelivr.net/npm/mermaid@8/dist/mermaid.min.js', () => {
    mermaid.initialize({
      theme    : 'forest',
      logLevel : 3,
      flowchart: { curve     : 'linear' },
      gantt    : { axisFormat: '%m/%d/%Y' },
      sequence : { actorMargin: 50 }
    });
  }, window.mermaid);
}
</script>


  

  


<script>
NexT.utils.loadComments(document.querySelector('#valine-comments'), () => {
  NexT.utils.getScript('//unpkg.com/valine/dist/Valine.min.js', () => {
    var GUEST = ['nick', 'mail', 'link'];
    var guest = 'nick,mail,link';
    guest = guest.split(',').filter(item => {
      return GUEST.includes(item);
    });
    new Valine({
      el         : '#valine-comments',
      verify     : false,
      notify     : false,
      appId      : 'bx3R5BB7VYCe0Yu5f4PF2Ako-gzGzoHsz',
      appKey     : '24eOkgM1v8hYTlnAO3C2eG3n',
      placeholder: "欢迎留言评论",
      avatar     : 'mm',
      meta       : guest,
      pageSize   : '10' || 10,
      visitor    : false,
      lang       : 'zh-cn' || 'zh-cn',
      path       : location.pathname,
      recordIP   : false,
      serverURLs : ''
    });
  }, window.Valine);
});
</script>

</body>
</html>
